package ${module.package};

<#if table.hasUpdateUser()>
import org.apache.ibatis.annotations.Param;
</#if>
import ${table.enablePrimitiveType?string('com.cellulam.framework.datasource.dao.BaseSimpleCrudDao','com.cellulam.framework.datasource.dao.CrudDao')};
import ${poModule.package}.${table.beanName}Bean;
import org.springframework.stereotype.Component;
<#if table.hasUniqKey()>
import org.apache.ibatis.annotations.Param;
</#if>

/**
* dao for ${table.beanName} <br>
* Created by ${loginUser} on ${generateDate}.
*/
@Component
public interface ${table.beanName}Dao extends ${table.enablePrimitiveType?string('BaseSimpleCrudDao','CrudDao')}<${table.pk.wrapperFieldType.simpleName}, ${table.beanName}Bean> {
<#if table.generateDel()>
    <#if table.hasUpdateUser()>
    /**
     * 删除
     * @param id
     * @param userId
     * @return 删除是否成功
     */
    int delete(@Param("id") ${table.pk.fieldType.simpleName} id, @Param("userId") int userId);
    <#else>
    /**
     * 删除
     * @param id
     * @return 删除是否成功
     */
    int delete(${table.pk.fieldType.simpleName} id);
    </#if>
</#if>

<#if table.hasUniqKey()>

    /**
     * 锁行执行
     */
    ${table.beanName}Bean lockByKey(${table.uniqKeyParamsDao});
</#if>

}
